Organization: Ericsson Telecom Systems Labs, Stockholm, Sweden
Message-ID: <4i6o3j$e93@euas20.eua.ericsson.se>
Reply-To: etxmide@eua.ericsson.se
NNTP-Posting-Host: euas31i3c39.eua.ericsson.se
NNTP-Posting-User: etxmide
I am have a list class and a Listiterator class, based on templates. To test the classes I use a simple main.c - file:
-----------------------
#include "list.h"
#include "listIterator.h"
main() {
List<int> myList;
Listiterator<int> myIterator(myList);
}
-----------------------
Compiling these files goes successfully, however, when doing the same thing in the header file 'XXY.h':
-----------------------
#include "list.h"
#include "listIterator.h" // I have ommited trivial things
class XXY {
List<int> myList;
Listiterator<int> myIterator(myList);
};
----------------------
, the compiler complains at the Listiterator initialization. What is wrong? How will I instantiate and initialize a data member which is a template-class?